package com.sky.mapper;

import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishFlavorMapper {
    /**
     * 向口味表中插入n条数据
     * @param flavors
     */
    void insert(List<DishFlavor> flavors);

    /**
     * 批量删除菜品的口味数据数据
     * @param idList
     */
    void deleteBatch(List<Long> idList);

    /**
     * 根据id查询口味数据
     * @param id
     * @return
     */
    @Select("select * from sky_take_out.dish_flavor where dish_id = #{id}")
    List<DishFlavor> selectById(Long id);
}
